import React from 'react'
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'
// import Layout from '@/pages/Layout/index'
// import Login from '@/pages/Login/indedx'
const Layout = React.lazy(() => import('@/pages/Layout/index'))
const Login = React.lazy(() => import('@/pages/Login/indedx'))
const NotFount = React.lazy(() => import('@/pages/NotFount/index'))

export default function App() {
  return (
    <Router>
      <React.Suspense fallback={<div>loading..</div>}>
        <Switch>
          <Redirect exact path="/" to="/layout"></Redirect>
          <Route path="/login" component={Login}></Route>
          <Route path="/layout" component={Layout}></Route>
          <Route path="*" component={NotFount}></Route>
        </Switch>
      </React.Suspense>
    </Router>
  )
}
